﻿{% extends "base.html" %}

{% block scripts %}
{% endblock %}

{% block content %}
        		<h1>Все клиенты</h1>
				
	            <!--
                <ul class="tabs_list friends_tabs">
					<li class="item item_current"><a href="/users/">Все пользователи</a><span class="bg"></span></li>
					<li class="item"><a href="/online_users/">Пользователи онлайн</a><span class="bg"></span></li>
				</ul>
				-->
				
				<ul class="paging">
                    {% if users.has_previous %}
					<li><a href="/users/{{ users.previous_page_number }}/"><img class="icon" src="/media/images/icon_arrow_2.gif" width="11" height="5"></a></li>
					{% endif %}

                    {% for page in users.paginator.page_range %}
                        {% if page == users.number %}
                            <li class="item item_current">{{ page }}</li>
                        {% else %}
                            <li class="item"> <a href="/users/{{ page }}/">{{ page }}</a></li>
                        {% endif %}
                    {% endfor %}

                    {% if users.has_next %}
					<li><a href="/users/{{ users.next_page_number }}/"><img class="icon" src="/media/images/icon_arrow_1.gif" width="11" height="5"></a></li>
					{% endif %}
				</ul>
				
				<ul class="info_list_1 friends_list">
                    {% for usr in users.object_list %}
                        <li class="list_item {% if forloop.first %}list_item_first{% endif %}">
                            <img class="pic"
                            {% if usr.user_info.avatar %}
                                src="{{ usr.user_info.avatar.url }}"
                                {% if usr.user_info.avatar.width > usr.user_info.avatar.height %}
                                width="79"
                                {% else %}
                                height="79"
                                {% endif %}
                            {% else %}
                                src="/media/images/nophoto.jpg/"
                                width="79" height="79"
                            {% endif %}/>
                            <div class="item_base">
                                <dl class="info">
                                    <dt>Имя:</dt>
                                        <dd><a href="/profile/{{ usr.id }}/">{{ usr.user_info.last_name }} {{ usr.user_info.first_name }}</a></dd>
                                    <dt>Компания:</dt>
                                        <dd><a href="#">Мы</a></dd>
                                </dl>
                            </div>
                            <ul class="options">
                                <!--<li class="item"><a href="#">Написать сообщение</a></li>-->
                                {% if request.user.is_authenticated %}
                                    {% if usr in request.user.user_info.friends.all %}
                                        <li class="item"><a href="/friends/cancel/{{ usr.id }}/">Удалить</a></li>
                                    {% else %}
                                        <li class="item"><a href="/friends/invite/{{ usr.id }}/">Добавить</a></li>
                                    {% endif %}
                                {% endif %}
                            </ul>
                        </li>
                    {% endfor %}
				</ul>

				
				<ul class="paging">
                    {% if users.has_previous %}
					<li><a href="/users/{{ users.previous_page_number }}/"><img class="icon" src="/media/images/icon_arrow_2.gif" width="11" height="5"></a></li>
					{% endif %}

                    {% for page in users.paginator.page_range %}
                        {% if page == users.number %}
                            <li class="item item_current">{{ page }}</li>
                        {% else %}
                            <li class="item"> <a href="/users/{{ page }}/">{{ page }}</a></li>
                        {% endif %}
                    {% endfor %}

                    {% if users.has_next %}
					<li><a href="/users/{{ users.next_page_number }}/"><img class="icon" src="/media/images/icon_arrow_1.gif" width="11" height="5"></a></li>
					{% endif %}
				</ul>
{% endblock %}